<?php
require_once(dirname(__FILE__).'/../../upgrade.php');
class rename_column_questions_qdetectrelatedquestions_detectrelated extends UPGRADE
{
	/**
	* IsAlreadyUpgraded
	* Do we need to run this classes upgrade script or not ?
	*
	* @return bool true if the upgrade has already run, otherwise false
	*/
	function IsAlreadyUpgraded()
	{
		return $this->ColumnExists($GLOBALS['tablePrefix'].'questions', 'detectrelated');
	}

	/**
	* Upgrade
	* Do the actual upgrade of this component. If this is successful all
	* subsequent calls to IsAlreadyUpgraded should return true
	*
	* @return void
	*/
	function Upgrade()
	{
		$query = '
			ALTER TABLE '.$GLOBALS['tablePrefix'].'questions CHANGE qDetectRelatedQuestions detectrelated TINYINT(1) NOT NULL
		';
		$result = $GLOBALS['AKB_DB']->Query($query);
	}

}
?>
